
<template>
	<div class="index">

		<div class="center">
			<left></left>
			<div class="right">
          <top></top>
      
		  <div class="hei10"></div>
		  <div class="where" style="background: #fff; padding: 10px 30px; font-size: 14px; color: #595959;">
		    当前位置：
		    <router-link to="/index" style="color: #409eff;">分销后台</router-link>>
		    <router-link to="/finance/onlinecommission" style="color: #409eff;">收入管理</router-link>>
		    查看提现记录
		  </div>
		  <div class="hei10"></div>         
                
                <div class="conlist" v-loading='loading'>
                    <div class="contilte">查看提现记录</div>
                    <div class="list">
                        <div class="th">上游供应商</div>
                        <div class="th">提现时间</div>
                        <div class="th">提现订单数量</div>
                        <div class="th">总金额</div>
                        <div class="th">提卡费</div>
                        <div class="th">扣除税点金额</div>
                        <div class="th">实际额度</div>
                        <div class="th">佣金状态</div>
                        <div class="th">打款时间</div>
                        <div class="th td2">操作</div>
                    </div>
                    <div class="list" v-for="item in list" :key="item.id">
                        <div class="td">{{item.up_name}}</div>
                        <div class="td">{{item.created_at}}</div>
                        <div class="td">{{item.count}}</div>
                        <div class="td">{{item.income_tika_cost + item.sum_amount}}</div>
                        <div class="td">{{item.income_tika_cost}}</div>
                        <div class="td">{{item.invoice}}</div>
                        <div class="td">{{item.real_amount}}</div>
                        <div class="td" v-if="item.transfer_time == null">未打款</div>
                        <div class="td" v-if="item.transfer_time != null">已打款</div>
                        <div class="td">{{item.transfer_time}}</div>
                        <div class="td td2">
                           <el-button type="text" @click="gohecha(item.uid)">数据核查</el-button>
                            <el-button type="text" @click="down(item.local_filename)">下载佣金明细</el-button>
                            <el-button type="text" v-if="item.image != null" @click="dakuan(item.image)">查看打款信息</el-button>
                        </div>
                    </div>

                    <el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="fanye" :page-size="pagesize" :total="total"></el-pagination>
                </div>
            </div>

        </div>

        <!-- <foot></foot> -->
        <el-dialog title="查看打款详情" :visible.sync="dakuanlog" :close-on-click-modal="false" width="600px">
            <div>
              <img :src="imageurl"  style="width: 100%;"/>
            </div>
            <div slot="footer" class="dialog-footer">
                  <el-button type="primary" size="small"  @click="dakuanlog = false">好的</el-button>
              </div>
        </el-dialog>
    </div>

</template>

<script>
    import axios from 'axios'
    import top from '@/components/top.vue'
    import left from '@/components/left.vue'
    import foot from '@/components/foot.vue'
    import QRcode from '@xkeshi/vue-qrcode';
    import moment from "moment";
    export default {
        components: {
            "left": left,
            "top": top,
            "foot": foot,
            qrcode : QRcode
        },
        name: "record",
        data() {
            return {
                month:"",
                total:0,
                pagesize:20,
                page:1,
                list:"",
                loading:true,
                form:{},
                dakuanlog:false,
                url:"",
                imageurl:""
            }
        },
        created() {
            this.url = window.location.origin+"/"
            var shop = JSON.parse(localStorage.getItem('SHOP'));
            this.shopname = shop.shop_name
            var that = this

            this.getlist()
        },
        mounted() {

        },
        methods: {
            gohecha:function(id){
              this.$router.push({
              	path: '/finance/onlinecommission/fazhan',
              	query: { id:id }
              })
            },
            down:function(url){
              const a = document.createElement('a');
              a.setAttribute('href', this.url + url);
              a.click();
            },
            dakuan:function(url){
                this.imageurl = this.url + url
                this.dakuanlog = true
            },
            search:function(){
                this.getlist()
            },
            //翻页
            fanye:function(page){
            	this.loading = true
            	this.page = page
            	this.getlist()
            },
            //获取列表
            getlist:function(){
                var that = this
                if(this.month == null){
                    this.month = ''
                }
                axios.get('/api/plan-market/up/confirm/list')
                	.then(response => {
                		if(response.data.msg.code == 0){
                            that.list = response.data.data.data
                            that.loading = false
                		}else{
                			that.$message.error(response.data.msg.info);
                		}
                	})
            },
        }
    }
</script>

<style lang="scss" scoped>
    .index{ 
        .el-pagination{ text-align: right; padding: 20px;}
        .moneylist{ display: flex;}
        .erimg{ width: 200px;}
        .red{ border: 1px #FF3B3B solid !important; color: #FF3B3B !important;}
        .moneylist div{ border: 1px #AAAAAA solid; width: 85px; height: 35px; line-height: 35px; text-align: center; margin-right: 10px; cursor: pointer;}
        
                .title{border-bottom: 1px #EAEAEA solid;  line-height: 45px; padding-left: 30px; font-size: 16px; background: #F9F9F9; color: #727272}
            
            .powertop{ display: flex; background:#f9f9f9; }
            .powertopli{ flex-basis: 160px; line-height: 45px; border-top: 4px #EBECEF solid; color: #727272; border-right: 1px #EAEAEA solid; font-size: 14px; text-align: center;}
            .powertopact{ background: #FFFFFF; border-top: 4px #DD2727 solid;}
            .con{  background: #FFFFFF; padding: 30px 40px; display: flex; justify-content: space-between;
                .conleft{ display: flex; flex-basis: 600px;
                  .l1{ flex-basis: 150px; text-align: center; font-size: 16px;}
                  .l2{ margin-bottom: 20px; color:#535353}
                  .l3{ color: #FF003D;}
                }
                .conright{ color:#197CFF; padding-top: 20px; cursor: pointer; }
            }
            .conlist{ padding-bottom: 20px; background: #FFFFFF; margin-top: 20px; min-height: 800px;
                .contilte{ line-height: 60px; padding-left: 20px; font-size: 15px; background: #FFFFFF;}
                .flex{ display: flex; justify-content: space-between}
                .gong{ display: flex;
                    .el-input__inner{ width: 250px;}
                    .el-button--danger{ margin-left: 20px;}
                }
                .list{ display: flex; border-bottom: 1px #eaeaea solid;
                    .th{ background: #EAEAEA; text-align: center; flex: 1; padding: 15px 0; font-size: 14px; }
                    .td{ background: #ffffff; text-align: center; flex: 1; padding: 5px 5px; height: 40px; font-size: 14px; line-height: 40px; overflow:
                    hidden;white-space: nowrap;text-overflow: ellipsis;}
                }
                .td2{ flex:2 !important;}
            }
    	
    }
</style>
